package com.hzlj.position.locate.common.enums;

import com.fz.common.base.exception.PubError;
import com.fz.common.base.exception.PubException;
import lombok.Getter;

/**
 * @author lifh
 * @date 2021/11/9 上午11:59
 **/
@Getter
public enum ReportAudioType {
    AUDIO("1", "语音汇报"),
    PHONE("2", "电话汇报"),
    ;

    private final String type;
    private final String typeText;

    ReportAudioType(String type, String typeText) {
        this.type = type;
        this.typeText = typeText;
    }

    public static ReportAudioType of(String type) {
        for (ReportAudioType statusEnum : values()) {
            if (statusEnum.type.equalsIgnoreCase(type)) {
                return statusEnum;
            }
        }
        throw new PubException(PubError.PARAM_EMPTY_ERROR);
    }
}
